feat(setup): honor AI_GATEWAY_BASE_URL when validating the gateway key#319
Open
brycedbjork wants to merge 1 commit into
Open
feat(setup): honor AI_GATEWAY_BASE_URL when validating the gateway key#319brycedbjork wants to merge 1 commit into
AI_GATEWAY_BASE_URL when validating the gateway key#319brycedbjork wants to merge 1 commit into
Conversation
validateGatewayApiKey built an @ai-sdk/gateway provider with no baseURL, so it always hit ai-gateway.vercel.sh. Forward AI_GATEWAY_BASE_URL to createGateway so the key check can target a self-hosted or proxied gateway. No behavior change when the variable is unset. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@brycedbjork is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
validateGatewayApiKeyconstructs an@ai-sdk/gatewayprovider with nobaseURL, so theAI_GATEWAY_API_KEYcheck always runs againstai-gateway.vercel.sh. This forwards theAI_GATEWAY_BASE_URLenvironment variable tocreateGateway, so anyone running eve against a self-hosted or proxied AI Gateway can validate their key against the same endpoint they actually use.createGatewayalready treats anundefined/emptybaseURLas "use the default", so there is no behavior change when the variable is unset.Notes
AI_GATEWAY_BASE_URLenv for the base URL ai#16401, which adds the sameAI_GATEWAY_BASE_URLfallback inside@ai-sdk/gatewayitself (covering the default/global provider used for runtime inference). This makes eve's owncreateGatewaycall honor it directly, without waiting on that release.gateway-models.ts/model-catalog.ts) go throughvercel curlagainst the/v1/modelsAPI — a separate code path and endpoint — so they're intentionally left out of this change. Happy to follow up on those if desired.